package com.aphrodite.io.sip.message;

/**
 * Class SipMethods extends org.zoolu.sip.message.BaseSipMethods and collects
 * all SIP method names.
 */
public final class SipMethods extends BaseSipMethods {

	/** String "MESSAGE" for method MESSAGE defined in RFC3428 */
	public static final String MESSAGE = "MESSAGE";

	// ****************************** Extensions
	// *******************************/
	/** String "NOTIFY" */
	public static final String NOTIFY = "NOTIFY";
	/** String "PUBLISH" for method PUBLISH defined in RFC3903 */
	public static final String PUBLISH = "PUBLISH";

	/** String "REFER" for method REFER defined in RFC3515 */
	public static final String REFER = "REFER";

	/** String "SUBSCRIBE" */
	public static final String SUBSCRIBE = "SUBSCRIBE";
	/** Array of all methods ( standard (RFC3261) + new (RFC3428,..) ) */
	public static final String[] methods = { INVITE, ACK, CANCEL, BYE, INFO, OPTION, REGISTER, UPDATE, SUBSCRIBE,
			NOTIFY, MESSAGE, REFER, PUBLISH };
	/** Array of all methods that create a dialog */
	public static final String[] dialog_methods = { INVITE, SUBSCRIBE };

	/** Whether <i>str</i> is MESSAGE */
	public static boolean isMessage(String str) {
		return same(str, MESSAGE);
	}

	/** Whether <i>str</i> is NOTIFY */
	public static boolean isNotify(String str) {
		return same(str, NOTIFY);
	}

	/** Whether <i>str</i> is PUBLISH */
	public static boolean isPublish(String str) {
		return same(str, PUBLISH);
	}

	/** Whether <i>str</i> is REFER */
	public static boolean isRefer(String str) {
		return same(str, REFER);
	}

	/** Whether <i>str</i> is SUBSCRIBE */
	public static boolean isSubscribe(String str) {
		return same(str, SUBSCRIBE);
	}
}
